const mongoose =require("mongoose");
const Schema=mongoose.Schema;

//Create Scahema
const CommentSchema=new Schema({
    post:{
        type: Schema.Types.ObjectId,
    },
    user:{
        type: Schema.Types.ObjectId, ref: 'users',
        required:true,
    },
    content:{
        type:String,
        require:true,
    },
    date:{
        type:Date,
        default:Date.now
    },
})

module.exports=Comment=mongoose.model("comments",CommentSchema);